﻿#include<iostream>


#include"map.h"
#include"set.h"
using namespace std;

int main()
{
	Map::map<int, int> m;
	m.insert(make_pair(1, 1));
	m.insert(make_pair(2, 2));
	m.insert(make_pair(3, 3));

	auto mit = m.begin();
	while (mit != m.end())
	{
		cout << mit->first << ":" << mit->second<< endl;

		++mit;
	}

	Set::set<int> s;
	s.insert(1);
	s.insert(2);
	s.insert(3);
	s.insert(4);
	s.insert(5);
	s.insert(6);
	auto sit = s.begin();
	while (sit != s.end())
	{
		cout << *sit <<" ";
		++sit;

	}

	for (auto& e : s)
	{
		cout << e << " ";
	}

	Map::map<string, string> dict;
	dict.insert(make_pair("sort", "xxx"));
	dict["left"]; // 插入

	for (const auto& kv : dict)
	{
		cout << kv.first << ":" << kv.second << endl;
	}
	cout << endl;

	dict["left"] = "左边"; // 修改
	dict["sort"] = "排序"; // 修改
	dict["right"] = "右边"; // 插入+修改

	for (const auto& kv : dict)
	{
		cout << kv.first << ":" << kv.second << endl;
	}
	cout << endl;


	return 0;
}
